UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'I8npaejIa34/dLwco+BVnRJNBtoE9jzlQf9mzccCLlE=' 
WHERE 
  key_id = '8ca88ebc3100f77414f682252c6d89bb0d6e1cc7e17bcd83e96c0c008e31f22f' 
  AND (
    token = 'I8npaejIa34/dLwco+BVnRJNBtoE9jzlQf9mzccCLlE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044