UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'j8il/yRBG9Bq8OEfqtCvIrqSO5HyaCr6Y+I3r25KXyk='
WHERE
key_id = '573298ad647f12ee8c94502e065c446493309fe72f148bfc0f969673a4c2f696'
AND (
token = 'j8il/yRBG9Bq8OEfqtCvIrqSO5HyaCr6Y+I3r25KXyk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)