UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '44Om3NEQLyK3aMF1HLryGrGEriNSukNeceRu/ZFlzsg=' 
WHERE 
  key_id = '6325b1eaf7322541a845947a7da8e9375b97ef285599bbf2b546a364effef304' 
  AND (
    token = '44Om3NEQLyK3aMF1HLryGrGEriNSukNeceRu/ZFlzsg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039