UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HshIiGiHzkqkuIR2M34zpjvaYhtZ1lEumhqGV4xl9Io=' 
WHERE 
  key_id = '6b024f39e44e4e161e70df3da81c6f6f9943d8426a099bbfbfbca5519b01db2f' 
  AND (
    token = 'HshIiGiHzkqkuIR2M34zpjvaYhtZ1lEumhqGV4xl9Io=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044