UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '43d4RJcJN3yNjsWIr8SP4ccn1GyHEzDiv4IkJyn1AWk='
WHERE
key_id = 'b0ad5a9a3f908901acb13e4649412ec98a704af9c8805b06a6fdd0bfa903b0a6'
AND (
token = '43d4RJcJN3yNjsWIr8SP4ccn1GyHEzDiv4IkJyn1AWk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)