UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JA9pPBF9mzUHNtDd8YkcYI6bo5kkrQvO5reT8SPwyqg=' 
WHERE 
  key_id = '0337f60aac9584bedd308b536a8ccabde44858ff8e838f883a79145b956e2244' 
  AND (
    token = 'JA9pPBF9mzUHNtDd8YkcYI6bo5kkrQvO5reT8SPwyqg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031