UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GTYqoBM9YUXDQ4lBLofKVRVMj2R9W6FONbT3dWItEiY='
WHERE
key_id = 'b684e5852da467b5c9e1a5413be2e4b847c1a96e04f1c40cfb82a71e0efbace0'
AND (
token = 'GTYqoBM9YUXDQ4lBLofKVRVMj2R9W6FONbT3dWItEiY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)