UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'whwDDPT/+CZuJLo/Spe7hbwGX7z2uVaLMGiHJ0RCo/I=' 
WHERE 
  key_id = '61be563d50f263924ace77b7508294757013faeea98670897c32e8f86d3a0abe' 
  AND (
    token = 'whwDDPT/+CZuJLo/Spe7hbwGX7z2uVaLMGiHJ0RCo/I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036