UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iUx+XzSwr4wYAW3Hf9EVn2m9OanShHC6B4yOVZcUXiA='
WHERE
key_id = '920867a716154f23d8a3f6f9d7edf3a70253a8a6635a5810ed58618ae9b9b8fb'
AND (
token = 'iUx+XzSwr4wYAW3Hf9EVn2m9OanShHC6B4yOVZcUXiA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)