UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Lhi/WbrzzfoAw5aoxrczY2JR6xOR8jw7qNFrFw+hs8c='
WHERE
key_id = '4e40003392c6044a9c1b136f3896f51eaf00f3a5c298efed59bcda9d06e4a3a7'
AND (
token = 'Lhi/WbrzzfoAw5aoxrczY2JR6xOR8jw7qNFrFw+hs8c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)