UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jBY1qgR5rPEL7m/rrptMIytBmnbYJk65wNDJRoVe/0Q='
WHERE
key_id = '445a2522ff545fc09b8f18cec06318affd4889cc5f38166f9feaffda559ba37d'
AND (
token = 'jBY1qgR5rPEL7m/rrptMIytBmnbYJk65wNDJRoVe/0Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)