UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nceFdzXh3MMreeFuIemweWIIBPUUmtNnpwBaGGPa1Eg=' 
WHERE 
  key_id = '942f594607afdac8ff76b877d241531f827ee4addc1f3aa626ef699d129bba60' 
  AND (
    token = 'nceFdzXh3MMreeFuIemweWIIBPUUmtNnpwBaGGPa1Eg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031