UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yZcwGxz6gbh1IvDek3NnGgNxHsDrepSsO8r8nn8vaO8=' 
WHERE 
  key_id = '4cfe90c7a6cdcd52b198d96170fc041dcba818c8d61ed46b695cbed152c1340f' 
  AND (
    token = 'yZcwGxz6gbh1IvDek3NnGgNxHsDrepSsO8r8nn8vaO8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029