UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5dnqyLIdbmFTDQhlTv0TEMLNk2SFq71tKbbdmAsVLvE=' 
WHERE 
  key_id = '94c69b717714cf7e63856133dc1b415c6bc52ac76e5ca6a1a71e9416507d16e1' 
  AND (
    token = '5dnqyLIdbmFTDQhlTv0TEMLNk2SFq71tKbbdmAsVLvE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031