UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'p+HhEYJNX/vZYSs5WX596hbqAiVsTKJ9VGvis56cP0E='
WHERE
key_id = 'e084ef77bb7bbe0ee3abe90b3a3cbb8a6ab5c01aa4210badc5fe90f6bb2bb932'
AND (
token = 'p+HhEYJNX/vZYSs5WX596hbqAiVsTKJ9VGvis56cP0E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)