UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ggTmM1NPEs/xjOtWmYmiEpqNl3gun/rQgp35PFkyVBk=' 
WHERE 
  key_id = '541bbbec68ed7a6b8c981a60b98d11c6a3b779670a54ce82c495f835ac3a7867' 
  AND (
    token = 'ggTmM1NPEs/xjOtWmYmiEpqNl3gun/rQgp35PFkyVBk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00097