UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Fyhc4fV+qtp/YaCjb6dJ7//cDypy5/REgNEywP2LNS4='
WHERE
key_id = 'f363c1561e12f9d7d934e69f6275638713da61c16993275b26beb8131d2b13ff'
AND (
token = 'Fyhc4fV+qtp/YaCjb6dJ7//cDypy5/REgNEywP2LNS4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)