UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xGZnS4bz+8Yo3L0kr9fyQjgcmXW6ajIN3rBNxqUbXhA='
WHERE
key_id = '3211c21f556e91cbef8283828ec026e36dae7f5d2f4b6138096ab1d322e58da0'
AND (
token = 'xGZnS4bz+8Yo3L0kr9fyQjgcmXW6ajIN3rBNxqUbXhA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)