UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wxOHeHjMMKF/ZwnIHEnhdfMeXYEPNLoptdVCDzqN0yg='
WHERE
key_id = '87d31ff2731de106552ec3e12c770d5d669dd9cff680c3ecffc3fd095530282f'
AND (
token = 'wxOHeHjMMKF/ZwnIHEnhdfMeXYEPNLoptdVCDzqN0yg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)