UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ewzs45qbg69t5jkt7ydmCy9r3NJdpGZqZYVLHDvELZQ='
WHERE
key_id = 'bda02d8c409eaadf0e7e0acda872d19dc69d25718beedf5c5364ec3284c0e2b2'
AND (
token = 'ewzs45qbg69t5jkt7ydmCy9r3NJdpGZqZYVLHDvELZQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)