UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6JgQW+1Y+rG8bODvzHiMPEo8PIhLm42gNeavo2sQFsg=' 
WHERE 
  key_id = '5da8f65d14c19e7633364ad837aefeec73c747ee5260a3b72afd1b81cd09d786' 
  AND (
    token = '6JgQW+1Y+rG8bODvzHiMPEo8PIhLm42gNeavo2sQFsg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018