UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7A/90H51g/iM04VbgT0XhT3jenw0YfejxnKqoRDs7jY='
WHERE
key_id = '5451f5336091c8e0985b51a415725aa88c8a7fe4ce248a7966adec232f56130e'
AND (
token = '7A/90H51g/iM04VbgT0XhT3jenw0YfejxnKqoRDs7jY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)