UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BLsXCMZ8dH/ncVxp7g2TRgWBivrI/raveeHVBEjfdo8=' 
WHERE 
  key_id = 'c0ed65f7bef7722a153d36346aeaac1f880d0f985f9d9b8bd10d2030717fedf5' 
  AND (
    token = 'BLsXCMZ8dH/ncVxp7g2TRgWBivrI/raveeHVBEjfdo8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029