UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rA9lKfYJEEvNwXFVQLkPn72Sv44TrWt+HKxZ7AmWgx4='
WHERE
key_id = '1cc7015f0c338ac34e93053b4e913ed3dfb016c0ec05e3918c655d4eeb77b34c'
AND (
token = 'rA9lKfYJEEvNwXFVQLkPn72Sv44TrWt+HKxZ7AmWgx4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)