UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YMFCYPCPRx5UWjpP2Kn61yW/weVbJbD8JFp0iBrDTd8='
WHERE
key_id = 'e9e882a5947e7e4b5ff564f90c220e9a8f5d9b2d479fb4976903dc0ff7672dac'
AND (
token = 'YMFCYPCPRx5UWjpP2Kn61yW/weVbJbD8JFp0iBrDTd8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)