UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RgL1YjObO1zO2BbslU1+Kv06rUu+j0GxYhpbcZj1khA=' 
WHERE 
  key_id = 'ee64b0150e20bd605771fe1c6a19644759eaf7d88d4ab6fbd96a0a75ff9eecce' 
  AND (
    token = 'RgL1YjObO1zO2BbslU1+Kv06rUu+j0GxYhpbcZj1khA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034