UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '59psmDYv8D+71pZZlyL3jYg4xfZdRWqr3B9/rdQSAlE='
WHERE
key_id = 'da5dd93451fbb190827d5b52c0460a63d7b22fe3a6fcd5f6baf333a0c946c66c'
AND (
token = '59psmDYv8D+71pZZlyL3jYg4xfZdRWqr3B9/rdQSAlE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)