UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qY7ksF8dK5HPTGGc3Rdvk0PpTE4RnE4WsudJcPvUZGs='
WHERE
key_id = '618fea1ea67304ac6d0c0e69ceee52bc2088964ec558ed31cd1015b451e80ae3'
AND (
token = 'qY7ksF8dK5HPTGGc3Rdvk0PpTE4RnE4WsudJcPvUZGs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)