UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+VMO5nOh7r6SEAii6ON2fEEKWLl1LTdcysR+p2N6AUA=' 
WHERE 
  key_id = '09c4d9c5e95afd57ba91a91b42d2a9eeda261d2b736abcec13f7ca16c9b2bb6b' 
  AND (
    token = '+VMO5nOh7r6SEAii6ON2fEEKWLl1LTdcysR+p2N6AUA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038