UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'z/ybG/YS3wVixolS+zmDkZSIH7iurrcRdwBRi9FpBII='
WHERE
key_id = '8736c9dde4e4740207aad00bc64ba5e1fca459c634284091537b7bf3ef218215'
AND (
token = 'z/ybG/YS3wVixolS+zmDkZSIH7iurrcRdwBRi9FpBII='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)