UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KX755xXdNTSMQFBjiBnsawIhhXzAbFoxxKdwUUzZaSo='
WHERE
key_id = '6dc46d80ef95dd18343df31f259345570e9ecf5453a7a8a0f2784465646f0db2'
AND (
token = 'KX755xXdNTSMQFBjiBnsawIhhXzAbFoxxKdwUUzZaSo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)