UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+WczXz2N2BEfxmosBFPlpZC6LWgRLTS6bCY2k4cC6iA='
WHERE
key_id = '59a0c6a4880074cb4fa47beb7b3ae7f76f833330c8c2b2dfc3f47e18b4bc53c8'
AND (
token = '+WczXz2N2BEfxmosBFPlpZC6LWgRLTS6bCY2k4cC6iA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)