UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'M4vTux3oYmhAwW6/IhkTn8muvcT5eUS/L9VQi5LJ6Sg='
WHERE
key_id = '54582522dd89b75b1fa5831156d8e18c3ef0d9fbc75dded33447c04f0dd2049f'
AND (
token = 'M4vTux3oYmhAwW6/IhkTn8muvcT5eUS/L9VQi5LJ6Sg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)